x = {"zero":0,"one":1,"two":2,"three":3,"four":4,"five":5,"six":6,"seven":8,"nine":9}
y = input()
z = c.split(" ")
n = ''
w = [2]
m = 1001
for i in range(100,n+1):
    g = 0
    for b in range w:
        if i %b==0:
            g = 1
    if g==0:
        w.append(i)

for i in range(len(z)):
    j = z[i]
    s = s + str(x[j])
s = int(s)

if s in w:
    print(s)
else:
    w.append(p)
    print(sorted(w))
    for i in range(len(w)):
        if s in w:
            print(w[i])
